package cn.fyl.feign;

import cn.fyl.domain.User;
import feign.hystrix.FallbackFactory;
import org.springframework.stereotype.Component;

@Component
public class UserFallBack implements FallbackFactory<UserFeignServer> {

    @Override
    public UserFeignServer create(Throwable throwable) {
        return new UserFeignServer() {
            @Override
            public User getById(Long id) {
                return new User(-1L,"熔断了","滚开");
            }
        };
    }
}
